package com.liu.concurrent.thread;


public class ByImplementsRunnable {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(new MyThreadByRunnable(), "thread-" + i).start();
        }
    }
}

/**
 * 通过实现Callable接口实现多线程
 */
class MyThreadByRunnable implements Runnable {

    /**
     * 重写call方法
     */
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
    }
}
